contract ViewContract {
function someFunction() public returns(address) {
return msg.sender;
}
}
A. view
B. pure
C. either view or pure would do
D. None of these
Q71: What issue would the following code have?
// SPDX-License-Identifier: SOME IDENTIFIER
pragma solidity ^0.8.10;
contract ViewContract {
function someFunction(uint a, uint b) public returns(uint) {
return a+b;
}
}
A. No issue at all, the code would compile and run perfectly
B. The code would throw warnings as it’s not marked properly
C. The code is incomplete as there is no need of initializing the
state variables
D. None of these
Q72: What issue would the following code have?
// SPDX-License-Identifier: SOME IDENTIFIER
pragma solidity ^0.8.10;
contract ViewContract {
function someFunction(uint a, uint b) public view
returns(uint) {
return a+b;
}